6 int m
[203][203], dp
[203][203];
11 memset(m
, 0, sizeof(m
));
12 memset(dp
, 0, sizeof(dp
));
13 for (int i
=1; i
<=n
; ++i
)
14 for (int j
=1; j
<=n
; ++j
)
18 for (int i
=1; i
<=n
; ++i
)
19 for (int j
=1; j
<=n
; ++j
)
20 dp
[i
][j
] = dp
[i
][j
-1] + m
[i
][j
] + dp
[i
-1][j
] - dp
[i
-1][j
-1];
24 // for (int i=0; i<=n+1; ++i){
25 // for (int j=0; j<=n+1; ++j)
26 // cerr << m[i][j] << " ";
29 // cerr << "\ndp es:\n";
30 // for (int i=0; i<=n+1; ++i){
31 // for (int j=0; j<=n+1; ++j)
32 // cerr << dp[i][j] << " ";
37 for (int i
=n
; i
>=1; --i
)
38 for (int j
=n
; j
>=1; --j
)
39 for (int k
=1; k
<=i
; ++k
)
40 for (int l
=1; l
<=j
; ++l
){
41 int a
= dp
[i
][j
] - dp
[i
-k
][j
] - dp
[i
][j
-l
] + dp
[i
-k
][j
-l
];